package com.cndym.adapterForMobile.mobile.function;

import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.cndym.adapterForMobile.BaseFunction;
import com.cndym.exception.ErrCode;
import com.cndym.utils.Utils;
import com.zch.matches.producer.ISportMatchesProducer;

/**
 *查询联赛积分
 * 
 * @author Du Fangxing
 *
 */
@Component
public class ScoreSportMatchesFunc extends BaseFunction {
	
	private Logger logger = Logger.getLogger(getClass());
	
	@Autowired
	private ISportMatchesProducer sportMatchesProducer;

	@Override
	public Map<String, String> function(Map<String, String> map) {
		Map<String, String> param = paraMap(map);
		String lotteryCode = param.get("lotteryCode");
		String gameId = param.get("gameId");
		if(Utils.isEmpty(lotteryCode)){
			logger.error("查询联赛积分error:彩种类型为空!");
			return noBodyReMap(ErrCode.E4506);
		}
		if(Utils.isEmpty(gameId)){
			logger.error("查询联赛积分error:比赛ID为空!");
			return noBodyReMap(ErrCode.E4501);
		}
		Map<String, Object> resMap =sportMatchesProducer.scoreSportMatches(param);
		return successObj(resMap);
	}

}
